#coding:utf-8
from functools import reduce

def calc_sum(lst):
    def lazy_sum():
        return sum(lst)
    return lazy_sum



print(calc_sum([1,2,3,4,5]))
a=calc_sum([1,2,3,4,5])
print(a())

def calc_prod(lst):
    def lazy_prod():
        def f(x,y):
            return x*y
        return reduce(f,lst)
    return lazy_prod

f = calc_prod([1, 2, 3, 4])
print (f())
